import 'package:flutter/material.dart';
import 'package:flutter_deer/mvp/base_page_presenter.dart';
import 'package:flutter_deer/net/base_entity.dart';
import 'package:flutter_deer/net/net.dart';
import 'package:flutter_deer/shop/iview/agent_user_iview.dart';
import 'package:flutter_deer/shop/models/agent_user_entity.dart';


class AgentUserPagePresenter extends BasePagePresenter<AgentUserIMvpView> {

  @override
  void initState() {
    WidgetsBinding.instance.addPostFrameCallback((_) {
      /// 接口请求例子
      /// get请求参数queryParameters  post请求参数params
      asyncRequestNetwork<BaseEntity<List<AgentUserEntity>>>(Method.get,
        url: HttpApi.agentUserList,
        onSuccess: (data) {
          view.setAgentUserList(data?.data);
        },
        onError: (code,msg){

        }
      );
    });
  }

}